package com.example.lvsuo.controller.cxg;

import com.example.lvsuo.entity.cxg.vo.FlowDataLine;
import com.example.lvsuo.modal.Result;
import com.example.lvsuo.service.cxg.IFlowLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("flowlines")
public class FlowLineController {

@Autowired
IFlowLineService iFlowLineService;

    /**
     * 添加流程线
     * @param map
     * @return
     */
    @PostMapping
    public Result addLines(@RequestBody Map<String,Object> map){
//    System.out.println("前段数据："+map);
    iFlowLineService.addLines(map);
    return null;
}

    /**
     * 查询流程传流程线
     * @param fid
     * @return
     */
    @GetMapping("/{fid}")
public Result queryLineByid(@PathVariable String fid){
    List<FlowDataLine> flowDataLines = iFlowLineService.queryLineByid(fid);
    return  Result.back("ok","20000",flowDataLines);
}

@PutMapping
    public Result updateLine(@RequestBody Map<String,Object> map){
        iFlowLineService.updateLine(map);
        return  Result.back("ok","20000");
}


}
